package com.zzyl.mapper;

import com.github.pagehelper.Page;
import com.zzyl.entity.NursingPlan;
import com.zzyl.vo.NursingPlanVo;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * @Author 11913
 * @Date 2024/12/15 9:42
 * 
 * 护理计划Mapper层
 */

@Mapper
public interface NursingPlanMapper {




    /**
     * 删除护理计划
     * @param id
     */
    @Delete("DELETE FROM nursing_plan WHERE id = #{id}")
    void deleteById(Long id);

    /**
     * 护理计划条件分页查询
     * @param name
     * @param status
     * @param pageNum
     * @param pageSize
     * @return
     */
    Page<NursingPlanVo> searchNursingPlan(@Param("name") String name, @Param("status") Integer status, @Param("pageNum") Integer pageNum, @Param("pageSize") Integer pageSize);

    /**
     * 新增护理计划
     * @param nursingPlan
     */
    void save(NursingPlan nursingPlan);

    /**
     * 根据id查询护理计划
     * @param id
     * @return
     */
    NursingPlanVo getById(Long id);

    /**
     * 护理计划启用禁用
     * @param id
     * @param status
     */
    // void onOff(Long id, Integer status);

    /**
     * 修改护理计划
     * @param nursingPlan
     */
    void update(NursingPlan nursingPlan);

    /**
     * 查询所有护理计划
     * @return
     */
    @Select("SELECT id,create_time,update_time,create_by,update_by,plan_name,status FROM nursing_plan;")
    List<NursingPlan> findAll();
}